//
//  SettingViewController.m
//  Weibo
//
//  Created by Anasue on 9/21/15.
//  Copyright (c) 2015 Anasue. All rights reserved.
//

#import "SettingViewController.h"
#import "CommonGroup.h"
#import "CommonItem.h"
#import "CommonArrowItem.h"
#import "CommonSwitchItem.h"
#import "CommonLabelItem.h"
#import "GeneralSettingViewController.h"

@interface SettingViewController ()

@end

@implementation SettingViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupGroups];
}


- (void)setupGroups
{
    [self setupGroup0];
    [self setupGroup1];
    [self setupGroup2];
    
}

- (void)setupGroup0
{
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    CommonArrowItem *account = [CommonArrowItem itemWithTitle:@"账号"];
    group.items = @[account];
}

- (void)setupGroup1
{
    // 1.创建组
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    
    // 2.设置组的所有行数据
    CommonArrowItem *notices = [CommonArrowItem itemWithTitle:@"通知"];
    
    CommonArrowItem *notification = [CommonArrowItem itemWithTitle:@"隐私安全"];
    
    CommonArrowItem *settings = [CommonArrowItem itemWithTitle:@"通用"];
    
    group.items = @[notices, notification, settings];
}

- (void)setupGroup2
{
    // 1.创建组
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    
    // 2.设置组的所有行数据
    CommonArrowItem *clearCache = [CommonArrowItem itemWithTitle:@"清除缓存"];
    clearCache.destVcClass = [GeneralSettingViewController class];
    
    CommonArrowItem *feedback = [CommonArrowItem itemWithTitle:@"反馈"];
    
    CommonArrowItem *about = [CommonArrowItem itemWithTitle:@"关于"];
    
    group.items = @[clearCache, feedback, about];
}

@end
